/*  1:   */ package nl.siegmann.epublib.viewer;
/*  2:   */ 
/*  3:   */ import java.awt.GridLayout;
/*  4:   */ import java.awt.event.ActionEvent;
/*  5:   */ import java.awt.event.ActionListener;
/*  6:   */ import javax.swing.JButton;
/*  7:   */ import javax.swing.JPanel;
/*  8:   */ import nl.siegmann.epublib.browsersupport.Navigator;
/*  9:   */ 
/* 10:   */ class ButtonBar
/* 11:   */   extends JPanel
/* 12:   */ {
/* 13:   */   private static final long serialVersionUID = 6431437924245035812L;
/* 14:20 */   private JButton startButton = ViewerUtil.createButton("chapter-first", "|<");
/* 15:21 */   private JButton previousChapterButton = ViewerUtil.createButton("chapter-previous", "<<");
/* 16:22 */   private JButton previousPageButton = ViewerUtil.createButton("page-previous", "<");
/* 17:23 */   private JButton nextPageButton = ViewerUtil.createButton("page-next", ">");
/* 18:24 */   private JButton nextChapterButton = ViewerUtil.createButton("chapter-next", ">>");
/* 19:25 */   private JButton endButton = ViewerUtil.createButton("chapter-last", ">|");
/* 20:   */   private ContentPane chapterPane;
/* 21:27 */   private final ValueHolder<Navigator> navigatorHolder = new ValueHolder();
/* 22:   */   
/* 23:   */   public ButtonBar(Navigator navigator, ContentPane chapterPane)
/* 24:   */   {
/* 25:30 */     super(new GridLayout(0, 4));
/* 26:31 */     this.chapterPane = chapterPane;
/* 27:   */     
/* 28:33 */     JPanel bigPrevious = new JPanel(new GridLayout(0, 2));
/* 29:34 */     bigPrevious.add(this.startButton);
/* 30:35 */     bigPrevious.add(this.previousChapterButton);
/* 31:36 */     add(bigPrevious);
/* 32:   */     
/* 33:38 */     add(this.previousPageButton);
/* 34:39 */     add(this.nextPageButton);
/* 35:   */     
/* 36:41 */     JPanel bigNext = new JPanel(new GridLayout(0, 2));
/* 37:42 */     bigNext.add(this.nextChapterButton);
/* 38:43 */     bigNext.add(this.endButton);
/* 39:44 */     add(bigNext);
/* 40:   */     
/* 41:46 */     setSectionWalker(navigator);
/* 42:   */   }
/* 43:   */   
/* 44:   */   public void setSectionWalker(Navigator navigator)
/* 45:   */   {
/* 46:50 */     this.navigatorHolder.setValue(navigator);
/* 47:   */     
/* 48:52 */     this.startButton.addActionListener(new ActionListener()
/* 49:   */     {
/* 50:   */       public void actionPerformed(ActionEvent e)
/* 51:   */       {
/* 52:57 */         ((Navigator)ButtonBar.this.navigatorHolder.getValue()).gotoFirstSpineSection(ButtonBar.this);
/* 53:   */       }
/* 54:59 */     });
/* 55:60 */     this.previousChapterButton.addActionListener(new ActionListener()
/* 56:   */     {
/* 57:   */       public void actionPerformed(ActionEvent e)
/* 58:   */       {
/* 59:64 */         ((Navigator)ButtonBar.this.navigatorHolder.getValue()).gotoPreviousSpineSection(ButtonBar.this);
/* 60:   */       }
/* 61:66 */     });
/* 62:67 */     this.previousPageButton.addActionListener(new ActionListener()
/* 63:   */     {
/* 64:   */       public void actionPerformed(ActionEvent e)
/* 65:   */       {
/* 66:71 */         ButtonBar.this.chapterPane.gotoPreviousPage();
/* 67:   */       }
/* 68:74 */     });
/* 69:75 */     this.nextPageButton.addActionListener(new ActionListener()
/* 70:   */     {
/* 71:   */       public void actionPerformed(ActionEvent e)
/* 72:   */       {
/* 73:79 */         ButtonBar.this.chapterPane.gotoNextPage();
/* 74:   */       }
/* 75:81 */     });
/* 76:82 */     this.nextChapterButton.addActionListener(new ActionListener()
/* 77:   */     {
/* 78:   */       public void actionPerformed(ActionEvent e)
/* 79:   */       {
/* 80:86 */         ((Navigator)ButtonBar.this.navigatorHolder.getValue()).gotoNextSpineSection(ButtonBar.this);
/* 81:   */       }
/* 82:89 */     });
/* 83:90 */     this.endButton.addActionListener(new ActionListener()
/* 84:   */     {
/* 85:   */       public void actionPerformed(ActionEvent e)
/* 86:   */       {
/* 87:94 */         ((Navigator)ButtonBar.this.navigatorHolder.getValue()).gotoLastSpineSection(ButtonBar.this);
/* 88:   */       }
/* 89:   */     });
/* 90:   */   }
/* 91:   */ }


/* Location:           C:\Users\David\workspace\CosaRaraPorqueSi\main\epublib-tools-3.1.jar
 * Qualified Name:     nl.siegmann.epublib.viewer.ButtonBar
 * JD-Core Version:    0.7.0.1
 */